x86/xstate: don't clobber or leak state when using XSAVES
authorJan Beulich <jbeulich@suse.com>
Tue, 26 Apr 2016 09:53:18 +0000 (11:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 26 Apr 2016 09:53:18 +0000 (11:53 +0200)
commit0129e1ee0d61fc93f6101332719d0bb5de6718ad
tree273e70966ba40aea2fac93d111270d11526f1841
parent3a6222bd57209d4c2f098d61ace042370a9b0a96
x86/xstate: don't clobber or leak state when using XSAVES

Commit 4d27280572 ("x86/xsaves: fix overwriting between non-lazy/lazy
xsaves") switched to always saving full state when using compacted
format (which is the only one XSAVES allows). It didn't, however, also
adjust the restore side: In order to save full state, we also need to
make sure we always load full state, or else the subject vCPU's state
would get clobbered by that of the vCPU which happened to last have in
use the respective component(s).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/i387.c
xen/arch/x86/xstate.c
xen/include/asm-x86/xstate.h